// Copyright (C) 2022 Huawei Device Co., Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package routes

import (
	"dist/controllers"
	"net/http"
)

func CreateRoutes(mux *http.ServeMux) {
	mux.HandleFunc("/statistics/homePage", controllers.HomePage)
	mux.HandleFunc("/statistics/homepageChart", controllers.HomePageChart)
	mux.HandleFunc("/statistics/visit", controllers.Visit)
	mux.HandleFunc("/statistics/serverTime", controllers.ServerTime)
	mux.HandleFunc("/statistics/record", controllers.Record)
	mux.HandleFunc("/statistics/pageDistribution", controllers.PageDistribution)
	mux.HandleFunc("/statistics/pageUseRecord", controllers.PageUseRecord)
	// mux.HandleFunc("/statistics/pluginUsageStatistics", controllers.PluginUsageStatistics)
	mux.HandleFunc("/statistics/commandUseRecord", controllers.CommandUseRecord)
	mux.HandleFunc("/statistics/rowRecord", controllers.RowRecord)
	mux.HandleFunc("/statistics/rowSubRecord", controllers.RowSubRecord)
	mux.HandleFunc("/statistics/importTrace", controllers.ImportTrace)
	mux.HandleFunc("/statistics/downLoadUseRecord", controllers.DownLoadUseRecord)
	// host网页上报"插件使用数据"
	mux.HandleFunc("/statistics/recordPluginUsage", controllers.RecordPluginUsage)
	// statistic网页请求"插件使用数据"
	mux.HandleFunc("/statistics/requestPluginUsage", controllers.RequestPluginUsage)
	// 通用数据上报接口
	mux.HandleFunc("/statistics/generalRecord", controllers.GeneralRecord)
	// 通用数据查询接口
	mux.HandleFunc("/statistics/generalQuery", controllers.GeneralQuery)
}
